-- creator_bonus
-- create by panyl
-- 道具：  致命伤害

return {
    apply = function(source, target, classId, value)
        -- 命运の钥
        local level = 1;
        local dbase = PropertyM.query(classId, "dbase") or {};
        local path = dbase["prop_path"];
        if not path then
            path = "mixed";
        end

        -- 创世神专属加强效果
        local prop = PropM.combine(source, "creator", 1);
        level = PropM.apply(prop, level);

        -- 奖励
        local round = CombatM.getRound();
        local arr;
        for i = 1, level do
            arr = value[i];
            if type(arr[1]) == "table" then
                for _, _arr in pairs(arr) do
                    if #_arr < 4 then
                        if _arr[1] == 1 or _arr[1] == 2 then
                            --物品奖励or属性奖励
                            BonusM.doBonus(_arr, "apply_property");

                        end
                    else
                        --否则就是porp
                        if _arr[4] ~= -1 then
                            _arr[4] = _arr[4] + round + 1;
                        end
                        PropM.record(target, _arr, path);
                    end
                end
            else
                if #arr < 4 then
                    if arr[1] == 1 or arr[1] == 2 then
                        --物品奖励or属性奖励
                        BonusM.doBonus(arr, "apply_property");
                    end
                else
                    --否则就是porp
                    if arr[4] ~= -1 then
                        arr[4] = arr[4] + round + 1;
                    end
                    PropM.record(target, arr, path);
                end
            end
        end
    end,
};
